"""
This file is part of GSBEdit. For copyright and licensing information, please
see gsbedit.py in the GSBEdit base directory.
"""


import os.path

USER_PATH = os.path.expanduser(os.path.join('~'))

STEAM_PATH = os.path.join('Program Files', 'Steam', 'steamapps', 'common', 'gratuitous space battles')
STEAM64_PATH = os.path.join('Program Files (x86)', 'Steam', 'steamapps', 'common', 'gratuitous space battles')
DEFWIN_PATH = os.path.join('Program Files', 'Gratuitous Space Battles')
MAC_PATH_V1 = os.path.join('Applications', 'Gratuitous Space Battles.app', 'Contents', 'Resources')
MAC_PATH_V2 = os.path.join('Applications', 'Gratuitous Space Battles', 'Contents', 'Resources')

XP_BASE = 'C:\\'
WINE_BASE = os.path.join(USER_PATH, '.wine', 'drive_c')
MAC_BASE = '/'


def check_path(path, desc, path_list):
    if os.path.exists(path):
        path_list.append((path, desc))


def get_valid_paths():
    valid_paths = []

    check_path(os.path.join(XP_BASE, STEAM_PATH), 'Windows - Steam', valid_paths)
    check_path(os.path.join(XP_BASE, DEFWIN_PATH), 'Windows - Default', valid_paths)
    check_path(os.path.join(XP_BASE, STEAM64_PATH), 'Windows 64-bit - Steam', valid_paths)
    
    check_path(os.path.join(WINE_BASE, STEAM_PATH), 'Wine (Windows - Steam)', valid_paths)
    check_path(os.path.join(WINE_BASE, DEFWIN_PATH), 'Wine (Windows - Default)', valid_paths)
    check_path(os.path.join(WINE_BASE, STEAM64_PATH), 'Wine (Windows 64-bit - Steam)', valid_paths)
    
    check_path(os.path.join(MAC_BASE, MAC_PATH_V1), 'Mac - Default (V1)', valid_paths)
    check_path(os.path.join(MAC_BASE, MAC_PATH_V2), 'Mac - Default (V2)', valid_paths)
    
    check_path(os.path.join(USER_PATH, '.local', 'share', 'Steam', 'SteamApps', 'common', 'Gratuitous Space Battles'), 'Linux - Steam', valid_paths)
    
    # Just for Kemp
    check_path(os.path.join('media', '00843AC0843AB84C', STEAM_PATH), 'Kemp temp 1', valid_paths)
    check_path('/home/ramona/Documents/gsb/gsb', 'Kemp temp 2', valid_paths)

    return valid_paths

